package com.ferryc.modules.sys.entity.param;

import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.ferryc.commons.entity.DataEntity;
import com.ferryc.constant.ValidatorConstant;
import com.ferryc.modules.sys.entity.SysMenu;

/**
 * 
 * 类名: SysMenu <br/>
 * 作用： <br/>
 * 方法： <br/>
 * 创建者: Ferry C <br/>
 * 添加时间: 2017年11月26日 04:09:02 <br/>
 * 
 */
public class SysMenuParam extends DataEntity<SysMenuParam> {
	private static final long serialVersionUID = 1L;

	/** MenuId */
	private String menuId;

	/** MenuName */
	@NotBlank(message = ValidatorConstant.ERROR_MENU_NAME)
	@Length(min = 2, max = 40, message = ValidatorConstant.ERROR_MENU_NAME)
	private String menuName;

	/** 资源类型 */
	@NotBlank(message = ValidatorConstant.ERROR_MENU_TYPE)
	private String type;

	/** 图标 */
	private String icon;

	/** 资源路径 */
	@Length(max = 40, message = ValidatorConstant.ERROR_URL)
	private String url;

	/** ParentId */
	private String parentId;

	/** 权限字符串 */
	@Length(max = 40, message = ValidatorConstant.ERROR_PERMISSION)
	@Pattern(regexp = "[a-zA-Z0-9_]*", message = ValidatorConstant.ERROR_PERMISSION)
	private String permission;

	/** 排序 */
	private int sort;

	public String getMenuId() {
		return this.menuId;
	}

	public void setMenuId(String menuId) {
		this.menuId = menuId;
	}

	public String getMenuName() {
		return this.menuName;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getIcon() {
		return this.icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getParentId() {
		return this.parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getPermission() {
		return this.permission;
	}

	public void setPermission(String permission) {
		this.permission = permission;
	}

	public int getSort() {
		return sort;
	}

	public void setSort(int sort) {
		this.sort = sort;
	}

	public SysMenu toSysMenu() {
		SysMenu po = new SysMenu();
		po.setId(this.id);
		po.setMenuName(this.menuName);
		po.setType(this.type);
		po.setIcon(this.icon);
		po.setUrl(this.url);
		po.setParentId(this.parentId);
		po.setStatus(this.status);
		po.setPermission(this.permission);
		po.setSort(this.sort);
		po.setCreateBy(this.createBy);
		po.setCreateDate(this.createDate);
		po.setUpdateBy(this.updateBy);
		po.setUpdateDate(this.updateDate);
		po.setRemarks(this.remarks);
		po.setDelFlag(this.delFlag);
		po.setLimit(this.limit);
		po.setOffset(this.offset);
		po.setLikeName(this.likeName);
		return po;
	}

}